﻿using Swashbuckle.Swagger;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Http.Description;

namespace IOA.MES.EsbApi
{
    public class SwaggerHeaderFilter : IOperationFilter
    {
        public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription)
        {
            if (operation == null) return;

            if (operation.parameters == null)
            {
                operation.parameters = new List<Parameter>();
            }

            //var tokenParameter = new Parameter
            //{
            //    description = "Token令牌",
            //    @in = "header",
            //    name = "Token",
            //    required = false,
            //    type = "string",
            //};
            //operation.parameters.Add(tokenParameter);
        }
    }
}
